package pl.tomek.FileManager.View;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import pl.tomek.FileManager.Model.DataPicker;

public class MainFrame extends JFrame{

	private static final long serialVersionUID = -8745512110634658102L;
	
	private static final int WIDTH = 1000;
	private static final int HEIGHT = 1000;
	
	private static final String[] columnNames = {"Name", "Size", "Creation date"};
	
	private JScrollPane leftPane, rightPane;
	private JTable leftTabel, rightTabel;
	
	public void init() {
		setLocationByPlatform(true);
		setSize(WIDTH, HEIGHT);
		setLayout(new BorderLayout());
		initComponent();
	}
	public MainFrame(String frameName) {
		super(frameName);
		
	}
	
	private void initComponent() {
		initTables();
		leftPane = new JScrollPane(leftTabel);
		rightPane = new JScrollPane(rightTabel);
		add(leftPane, BorderLayout.WEST);
		add(rightPane, BorderLayout.EAST);
	}
	
	private void initTables() {
		leftTabel = new JTable(DataPicker.getData(), columnNames);
		rightTabel = new JTable(DataPicker.getData(), columnNames);

	}
}
